package com.ethan.lotgateway.netty;

import com.ethan.lotgateway.netty.config.NettyConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class ServerRunner implements CommandLineRunner {
    @Autowired
    NettyServer nettyServer;
    @Autowired
    NettyConfig nettyConfig;
    @Override
    public void run(String... args) throws Exception {
        log.info("netty端口已经启动："+nettyConfig.getPort());
        nettyServer.start(nettyConfig.getPort());

    }
}
